﻿
Public Class SidebarResetter


    Private Sub run_Click(sender As System.Object, e As System.EventArgs) Handles run.Click
        If RadioButton1.Checked Then
            Call r()
        ElseIf RadioButton2.Checked Then
            Call c()
        ElseIf RadioButton3.Checked Then
            Call ru()
        ElseIf RadioButton1.Checked = False And RadioButton2.Checked = False And RadioButton3.Checked = False Then
            Call eh()
        End If
        Return
    End Sub
    Public Sub c()
        Dim processList1() As Process
        processList1 = Process.GetProcessesByName("sidebar")
        For Each proc As Process In processList1
            If MsgBox("Close " & proc.ProcessName & "?", MsgBoxStyle.YesNo, "Close?") = MsgBoxResult.Yes Then
                proc.Kill()
                My.Computer.Audio.Play("C:\Windows\Media\tada.wav", AudioPlayMode.WaitToComplete)
            End If
        Next
        Return
    End Sub
    Public Sub r()
        Dim processList() As Process
        processList = Process.GetProcessesByName("sidebar")
        For Each proc As Process In processList
            If MsgBox("Reset " & proc.ProcessName & "?", MsgBoxStyle.YesNo, "Reset?") = MsgBoxResult.Yes Then
                proc.Kill()
            End If
        Next
        Process.Start("sidebar.exe")
        My.Computer.Audio.Play("C:\Windows\Media\tada.wav", AudioPlayMode.WaitToComplete)
        Return
    End Sub
    Public Sub eh()
        MsgBox(Prompt:="Please select an option.")
        Return
    End Sub
    Public Sub ru()
        If MsgBox("Run Sidebar ?", MsgBoxStyle.YesNo, "Run?") = MsgBoxResult.Yes Then
            Process.Start("sidebar.exe")
            My.Computer.Audio.Play("C:\Windows\Media\tada.wav", AudioPlayMode.WaitToComplete)
            Return
        Else
            Return
        End If

    End Sub

    Private Sub cancel_Click(sender As System.Object, e As System.EventArgs) Handles cancel.Click
        Close()
    End Sub

    Private Sub About_Click(sender As System.Object, e As System.EventArgs) Handles About.Click
        aboutform.Show()
    End Sub

    Private Sub Label3_Click(sender As System.Object, e As System.EventArgs) Handles Label3.Click
        MessageBox.Show("You clicked the about Label")
    End Sub

    Private Sub RadioButton1_CheckedChanged(sender As System.Object, e As System.EventArgs) Handles RadioButton1.CheckedChanged
    End Sub

    Private Sub RadioButton2_CheckedChanged(sender As System.Object, e As System.EventArgs) Handles RadioButton2.CheckedChanged
    End Sub

    Private Sub RadioButton3_CheckedChanged(sender As Object, e As EventArgs) Handles RadioButton3.CheckedChanged

    End Sub
End Class